package org.sjs.dreamfly.app

import android.app.Application
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner

class DreamFlyApplication : Application(), ViewModelStoreOwner {

    private var viewModelStore: ViewModelStore? = null
    companion object {
        lateinit var instance: DreamFlyApplication
    }

    override fun onCreate() {
        instance = this
        super.onCreate()
//        DataCenter.getDataProvider(HistoryDataProvider::class.java).loadFromFile()
//        LogUtil.d("density:${resources.displayMetrics.density}")
    }

    override fun getViewModelStore(): ViewModelStore {
        if (viewModelStore == null) {
            viewModelStore = ViewModelStore()
        }
        return viewModelStore!!
    }
}